package com.zzz.assistant.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import org.w3c.dom.Text;

public class MainActivity extends AppCompatActivity {

    private TextView mTextView;
    private Utils holder = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mTextView = findViewById(R.id.textView);

        findViewById(R.id.hold).setOnClickListener(view -> {
            holder = Utils.getInstance();
        });

        findViewById(R.id.unhold).setOnClickListener(v -> {
            holder = null;
        });

        findViewById(R.id.gc).setOnClickListener(v -> {
//            System.gc();
            Runtime.getRuntime().gc();
        });

        findViewById(R.id.test).setOnClickListener(v -> {
            String s = Utils.test();
            mTextView.setText(s);
        });
    }
}